*File: mayhew_comparison_ssh.do
*Purpose: Comparison to mayhew data


cap cd "~/div_gov"

insheet using data/cameron_surge2.csv, clear
drop descrip* title *cite
keep congress signif sweep1 sweep2

gen s_1 = sweep1=="TRUE"
gen s_2 = sweep2=="TRUE"
egen s_all = rmax(s_*)
collapse (sum) s_*, by(congress)
renpfix s mayhew
tempfile t
save `t', replace

insheet using data/cameron_surge2.csv, clear
drop descrip* title *cite
keep congress signif
gen c_a = signif=="A"
gen c_b = signif=="B"
gen c_c = signif=="C"
collapse (sum) c_*, by(congress)
egen c_all = rsum(c_*)
renpfix c_ cameron_
merge 1:1 congress using `t', nogen

corr *_all
merge 1:1 congress using data/congress_data, keepusing(sigact_n)
corr mayhew_all cameron_all sigact_n


gen cameron_ab = cameron_a + cameron_b
sort congress
keep if _m==3
label var mayhew_all "Mayhew (1991)"
label var cameron_ab "Howell et al. (2000)"
label var congress "Congress"

corr sigact mayhew_all
corr sigact cameron_ab
corr mayhew_all cameron_ab

count if (sigact<=mayhew_all & sigact>=cameron_ab) | (sigact>=mayhew_all & sigact<=cameron_ab)
count if (mayhew_all<=sigact & mayhew_all>=cameron_ab) | (mayhew_all>=sigact & mayhew_all<=cameron_ab)
count if (cameron_ab<=mayhew_all & cameron_ab>=sigact) | (cameron_ab>=mayhew_all & cameron_ab<=sigact)

gen year = congress*2 + 1787

graph twoway (line sigact_n year) ///
	(line mayhew_all year) ///
	(line cameron_ab year), ///
	scheme(tufte) xtitle("Year") ytitle("Number of Significant Acts") ///
	legend(cols(1) ring(0) position(2) size(small)) ///
	xscale(range(1946/1994)) xlabel(1946(4)1994)
graph export "figs_ssh/mayhew_comparison.pdf", replace
window manage close graph


// Stathis
//insheet using stathis_major_acts_counts.csv, clear comma
import delimited using data/Stathis_LandMarkLegDataCombined112514.csv, clear
gen n = 1
collapse (count) stathis=n, by(congress)
merge 1:1 congress using data/congress_data
label var stathis "Stathis (2014)"
label var sigact_n "Significant Legislation"
graph twoway (line sigact_n year) (line stathis year), ///
	scheme(tufte) xtitle("Year") ytitle("Number of Significant Acts") ///
	legend(cols(1) ring(0) position(2) size(small)) xlabel(1800(25)2000)
graph export "figs_ssh/stathis_comparison.pdf", replace
window manage close graph
